//
//  VerticalDashedLine.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/2/4.
//

import SwiftUI

// 自定义竖线形状
struct VerticalDashedLine: Shape {
    func path(in rect: CGRect) -> Path {
        var path = Path()
        path.move(to: CGPoint(x: rect.midX, y: rect.minY))
        path.addLine(to: CGPoint(x: rect.midX, y: rect.maxY))
        return path
    }
}

#Preview {
    VerticalDashedLine()
               .stroke(style: StrokeStyle(lineWidth: 1, dash: [5, 5])) // 设置线宽和虚线模式
               .frame(width: 1, height: 200) // 设置竖线的宽度和高度
               .foregroundColor(.black) // 设置线条颜色
}
